﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace drawstraws
{
    class Person : IComparable<Person>
    {
        // 姓名
        private string name;
        //权重
        private int rank;
        public Person(string _name,int _rank)
        {
            this.name = _name;
            this.rank = _rank;
        }
        //获取姓名
        public string Name
        {
            get{return name;}
        }
        //设置权重
        public int Rank
        {
            set { this.rank = value; }
            get { return rank; }
        }
        // 排序
        public int CompareTo(Person p)
        {
            return this.rank - p.rank;
        }

    }
}
